package java3_3;

import java.util.Scanner;

/**
 *10：(*)：用户输入任意一个正整数，求其所有位上的数字和并输出
 * 比如123，和为6,10000和为1。
 */
public class homework9 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int x = scanner.nextInt();
        int z = 0;
        int sum = 0;
        while (true){
             z = x%10;
             x = x/10;
             sum = sum +z;
             if (x/10 == 0){
                 sum = sum + x;
                 break;
             }
        }
        System.out.println(sum);
    }
}
